# -*- coding: utf-8 -*-
# 康虎软件工作室
# http://www.khcloud.net
# QQ: 360026606
# wechat: 360026606
#--------------------------
#
import os
import sys
import logging
import string
try :
 import simplejson as json
except ImportError :
 import json
import time
if 64 - 64: i11iIiiIii
try :
 import xml . etree . cElementTree as ET
except ImportError :
 import xml . etree . ElementTree as ET
from xml . dom import minidom
if 65 - 65: O0 / iIii1I11I1II1 % OoooooooOO - i1IIi
from odoo . exceptions import AccessError , UserError , ValidationError
from odoo import models , fields , api , _
try :
 from Crypto . Util . Padding import pad , unpad
 from Crypto . Cipher import AES
except ImportError as o0OO00 :
 raise ImportError ( 'Failed to load module Crypto! Please install pycryptodome first!' )
 if 78 - 78: i11i . oOooOoO0Oo0O
iI1 = logging . getLogger ( __name__ )
if 43 - 43: I11i11Ii
if 65 - 65: i1iIi11iIIi1I
import os
import sys
import hashlib
import string
import random
import base64
from binascii import b2a_hex , a2b_hex
if 78 - 78: i11ii11iIi11i . oOoO0oo0OOOo + IiiI / Iii1ii1II11i
from Crypto import Random
from Crypto . Cipher import AES
if 10 - 10: I1iII1iiII + I1Ii111 / OOo
i1i1II = ( 'C' )
O0oo0OO0 = ( 'FS' )
I1i1iiI1 = ( 'O' )
iiIIIII1i1iI = ( 'F' )
o0oO0 = ( 'T' )
oo00 = ( 'S' )
if 88 - 88: O0Oo0oO0o . II1iI . i1iIii1Ii1II
i1I1Iiii1111 = ( 't' )
i11 = ( 'u' )
I11 = ( 'd' )
Oo0o0000o0o0 = ( 'i' )
oOo0oooo00o = ( 'o72' )
oO0o0o0ooO0oO = ( '0' )
oo0o0O00 = ( '1' )
if 68 - 68: o00oo . i1iIi11iIIi1I + i11i
i11IiIiiIIIII = b'1234567890123456'
if 22 - 22: OOo * O0 / oOoO0oo0OOOo
def o00ooooO0oO ( ) :
 return '' . join ( i1i1II + O0oo0OO0 + I1i1iiI1 + iiIIIII1i1iI + o0oO0 + oo00 + i1I1Iiii1111 + i11 + I11 + Oo0o0000o0o0 + oOo0oooo00o + oO0o0o0ooO0oO + oo0o0O00 )
 if 63 - 63: i11ii11iIi11i % i1IIi
 if 66 - 66: OOo
oo0Ooo0 = len ( o00ooooO0oO ( ) )
I1I11I1I1I = lambda OooO0OO : OooO0OO + ( oo0Ooo0 - len ( OooO0OO ) % oo0Ooo0 ) * chr ( oo0Ooo0 - len ( OooO0OO ) % oo0Ooo0 )
iiiIi = lambda OooO0OO : OooO0OO [ 0 : - ord ( OooO0OO [ - 1 ] ) ]
if 24 - 24: O0 % oOoO0oo0OOOo + i1IIi + i1iIii1Ii1II + IiiI
class OOoO000O0OO ( object ) :
 def __init__ ( self , key = False , mode = AES . MODE_CBC ) :
  if 23 - 23: i11iIiiIii + oOooOoO0Oo0O
  if 68 - 68: i11ii11iIi11i . Iii1ii1II11i . i11iIiiIii
  if 40 - 40: Iii1ii1II11i . i11ii11iIi11i . I11i11Ii . i1IIi
  if 33 - 33: OOo + i11i % i11iIiiIii . o00oo - oOooOoO0Oo0O
  if 66 - 66: OOo - OoooooooOO * OoooooooOO . I1iII1iiII . IiiI
  if 22 - 22: OoooooooOO % I1Ii111 - O0Oo0oO0o . iIii1I11I1II1 * i11iIiiIii
  if 32 - 32: I11i11Ii * O0 % Iii1ii1II11i % OOo . II1iI
  if 61 - 61: o00oo
  if 79 - 79: I11i11Ii + oOooOoO0Oo0O - O0Oo0oO0o
  if 83 - 83: o00oo
  if 64 - 64: i1iIi11iIIi1I % o00oo % O0Oo0oO0o / i11ii11iIi11i - i1iIi11iIIi1I
  if 74 - 74: O0Oo0oO0o * O0
  if 89 - 89: Iii1ii1II11i + I11i11Ii
  if 3 - 3: i1IIi / oOooOoO0Oo0O % I1Ii111 * i11iIiiIii / O0 * I1Ii111
  self . key = key or o00ooooO0oO ( )
  self . mode = mode
  self . key = self . key . encode ( 'utf-8' )
  if 49 - 49: Iii1ii1II11i % OOo + i1IIi . oOooOoO0Oo0O % IiiI
 @ staticmethod
 def get_machine_code ( ) :
  import uuid
  if 48 - 48: I1Ii111 + I1Ii111 / i11i / iIii1I11I1II1
  return str ( uuid . UUID ( int = uuid . getnode ( ) ) )
  if 20 - 20: oOoO0oo0OOOo
 @ staticmethod
 def rand_aes_key ( size = 16 , by_base64 = True , chars = string . ascii_uppercase + string . digits ) :
  oO00 = '' . join ( random . choice ( chars ) for _ in range ( size ) )
  if 53 - 53: OoooooooOO . i1IIi
  if 18 - 18: oOoO0oo0OOOo
  if 28 - 28: I1iII1iiII - II1iI . II1iI + i11ii11iIi11i - OoooooooOO + O0
  if 95 - 95: i1iIi11iIIi1I % Iii1ii1II11i . O0
  if 15 - 15: o00oo / OOo . OOo - i1IIi
  if 53 - 53: II1iI + oOooOoO0Oo0O * Iii1ii1II11i
  return base64 . b64encode ( oO00 ) if by_base64 else oO00
  if 61 - 61: i1IIi * I1iII1iiII / OoooooooOO . i11iIiiIii . i11ii11iIi11i
  if 60 - 60: I1Ii111 / I1Ii111
 def encrypt ( self , text ) :
  if 46 - 46: OOo * I1iII1iiII - i1iIi11iIIi1I * Iii1ii1II11i - i1iIii1Ii1II
  text = pad ( text . encode ( 'utf-8' ) , block_size = 16 )
  oo0 = i11IiIiiIIIII
  if type ( i11IiIiiIIIII ) == 'str' :
   oo0 = i11IiIiiIIIII . encode ( "utf8" )
   if 57 - 57: I1iII1iiII . I1iII1iiII
  OooOooo = AES . new ( self . key , self . mode , i11IiIiiIIIII )
  if 97 - 97: o00oo - I1iII1iiII * i11iIiiIii / i11ii11iIi11i % i1iIii1Ii1II - OoooooooOO
  self . ciphertext = OooOooo . encrypt ( text )
  if 59 - 59: O0 + oOooOoO0Oo0O + II1iI % oOooOoO0Oo0O
  return base64 . b64encode ( self . ciphertext )
  if 70 - 70: O0Oo0oO0o * IiiI
  if 46 - 46: o00oo / i1iIi11iIIi1I
 def decrypt ( self , text ) :
  OOOoO0O0o = base64 . b64decode ( text )
  OooOooo = AES . new ( self . key , self . mode , i11IiIiiIIIII )
  if 55 - 55: I1iII1iiII + o00oo . i1IIi - IiiI . O0 - o00oo
  if 92 - 92: O0Oo0oO0o . I1Ii111 + oOoO0oo0OOOo
  if 28 - 28: i1IIi * I11i11Ii - oOoO0oo0OOOo * II1iI * OOo / i1iIi11iIIi1I
  if 94 - 94: i11i % IiiI / i11ii11iIi11i * iIii1I11I1II1
  if 54 - 54: oOoO0oo0OOOo - oOooOoO0Oo0O + OoooooooOO
  if 70 - 70: OOo / I1Ii111 . O0Oo0oO0o % I11i11Ii
  OOoOO00OOO0OO = bytes . decode ( unpad ( OooOooo . decrypt ( OOOoO0O0o ) , block_size = 16 ) )
  return OOoOO00OOO0OO
  if 16 - 16: oOooOoO0Oo0O * Iii1ii1II11i % II1iI
  if 86 - 86: oOooOoO0Oo0O + OOo % i11iIiiIii * Iii1ii1II11i . o00oo * I1Ii111
from Crypto import Random
from Crypto . Hash import SHA
from Crypto . Cipher import PKCS1_v1_5 as Cipher_pkcs1_v1_5
from Crypto . Signature import PKCS1_v1_5 as Signature_pkcs1_v1_5
from Crypto . PublicKey import RSA
if 44 - 44: Iii1ii1II11i
class o0o0oOoOO0 ( ) :
 if 17 - 17: II1iI
 if 62 - 62: iIii1I11I1II1 * i11ii11iIi11i
 if 26 - 26: O0Oo0oO0o . i1iIii1Ii1II
 if 68 - 68: i1iIi11iIIi1I
 if 35 - 35: i1iIi11iIIi1I - O0Oo0oO0o / I11i11Ii / i11ii11iIi11i
 if 24 - 24: o00oo - o00oo / i11i - IiiI
 if 69 - 69: Iii1ii1II11i . i1iIii1Ii1II + OOo / I11i11Ii - Iii1ii1II11i
 if 63 - 63: I1iII1iiII % Iii1ii1II11i * Iii1ii1II11i * i1iIi11iIIi1I / IiiI
 if 74 - 74: i11i
 if 75 - 75: oOoO0oo0OOOo . o00oo
 if 54 - 54: i11i % i11ii11iIi11i % I1Ii111 % iIii1I11I1II1 + iIii1I11I1II1 * o00oo
 if 87 - 87: o00oo * I11i11Ii % i11iIiiIii % i11ii11iIi11i - I1iII1iiII
 if 68 - 68: i1iIii1Ii1II % i1IIi . II1iI . IiiI
 if 92 - 92: O0Oo0oO0o . i1iIii1Ii1II
 if 31 - 31: i1iIii1Ii1II . i11ii11iIi11i / O0
 def __init__ ( self , pri_key = 'pri.pem' , pub_key = 'pub.pem' , key_path = os . path . abspath ( os . path . dirname ( __file__ ) ) ) :
  self . KEY_PRIVATE = pri_key
  self . KEY_PUBLIC = pub_key
  self . KEY_PATH = key_path
  if 89 - 89: i11ii11iIi11i
 def gen_key_pair ( self ) :
  if 68 - 68: i1iIi11iIIi1I * OoooooooOO % O0 + i1iIi11iIIi1I + o00oo
  i11i1I1 = Random . new ( ) . read
  if 36 - 36: iIii1I11I1II1 / i11ii11iIi11i * I1iII1iiII
  O0ii1ii1ii = RSA . generate ( 1024 , i11i1I1 )
  if 91 - 91: II1iI
  if 15 - 15: i11i
  Ii = O0ii1ii1ii . exportKey ( )
  if 79 - 79: OoooooooOO / O0
  with open ( self . KEY_PATH + "/" + self . KEY_PRIVATE , 'w' ) as OO0OoO0o00 :
   OO0OoO0o00 . write ( Ii )
   if 53 - 53: O0 * i1iIi11iIIi1I + I1iII1iiII
  IioOOo0 = O0ii1ii1ii . publickey ( ) . exportKey ( )
  with open ( self . KEY_PATH + "/" + self . KEY_PUBLIC , 'w' ) as OO0OoO0o00 :
   OO0OoO0o00 . write ( IioOOo0 )
   if 54 - 54: O0 - II1iI % I1iII1iiII
 def decrypt_str ( self , encrypt_text ) :
  if 77 - 77: i11ii11iIi11i / oOooOoO0Oo0O / i1iIi11iIIi1I + i1iIi11iIIi1I . I1iII1iiII
  ii1ii11IIIiiI = self . KEY_PATH + "/" + self . KEY_PUBLIC
  if not os . path . isfile ( ii1ii11IIIiiI ) :
   raise Exception ( "Decrypt key not exist or invalid!" )
   if 67 - 67: I1Ii111 * Iii1ii1II11i * IiiI + I1iII1iiII / i1IIi
  i11i1I1 = Random . new ( ) . read
  with open ( self . KEY_PATH + "/" + self . KEY_PRIVATE ) as OO0OoO0o00 :
   I1I111 = OO0OoO0o00 . read ( )
   Oo00oo0oO = RSA . importKey ( I1I111 )
   IIiIi1iI = Cipher_pkcs1_v1_5 . new ( Oo00oo0oO )
   OOoOO00OOO0OO = IIiIi1iI . decrypt ( base64 . b64decode ( encrypt_text ) , i11i1I1 )
   return OOoOO00OOO0OO
   if 35 - 35: OOo % O0 - O0
 def encrypt_str ( self , message ) :
  ii1ii11IIIiiI = self . KEY_PATH + "/" + self . KEY_PUBLIC
  if not os . path . isfile ( ii1ii11IIIiiI ) :
   raise Exception ( "Encrypt key not exist or invalid!" )
   if 16 - 16: i11i % i11ii11iIi11i - i11i + OOo
  with open ( ii1ii11IIIiiI ) as OO0OoO0o00 :
   I1I111 = OO0OoO0o00 . read ( )
   Oo00oo0oO = RSA . importKey ( I1I111 )
   IIiIi1iI = Cipher_pkcs1_v1_5 . new ( Oo00oo0oO )
   i1I1i = base64 . b64encode ( IIiIi1iI . encrypt ( message ) )
   return i1I1i
   if 40 - 40: oOooOoO0Oo0O . iIii1I11I1II1 / oOooOoO0Oo0O / i11iIiiIii
   if 75 - 75: I1Ii111 + oOoO0oo0OOOo
   if 84 - 84: II1iI . i11iIiiIii . II1iI * IiiI - I1Ii111
   if 42 - 42: i11iIiiIii
   if 33 - 33: O0Oo0oO0o - O0 * i1IIi * oOoO0oo0OOOo - I11i11Ii
   if 32 - 32: OoooooooOO / iIii1I11I1II1 - oOoO0oo0OOOo
   if 91 - 91: O0Oo0oO0o % i1IIi % iIii1I11I1II1
   if 20 - 20: I1iII1iiII % OOo / OOo + OOo
   if 45 - 45: Iii1ii1II11i - II1iI - OoooooooOO - i1iIi11iIIi1I . i11i / O0
   if 51 - 51: O0 + O0Oo0oO0o
   if 8 - 8: Iii1ii1II11i * i11ii11iIi11i - OOo - i1iIi11iIIi1I * I1iII1iiII % oOooOoO0Oo0O
   if 48 - 48: O0
I1IiiI = "report_"
IIi = "report_"
i1Iii1i1I = "report_"
if 91 - 91: IiiI + oOooOoO0Oo0O . I1iII1iiII * IiiI + oOooOoO0Oo0O * I11i11Ii
class O000OOOOOo ( models . Model ) :
 _name = 'cf.cfprint.license'
 _description = '许可证信息'
 if 22 - 22: i1IIi + O0 . iIii1I11I1II1 * O0Oo0oO0o % i11iIiiIii * oOooOoO0Oo0O
 mcode = fields . Char ( string = '机器码' , default = lambda oo000o : OOoO000O0OO . get_machine_code ( ) , help = '服务器机器码' )
 license = fields . Binary ( string = '许可证' , help = '授权许可证文件，下载后改名为cfprint.lic放到客户端cfprint目录下。' )
 note = fields . Char ( string = '备注' )
 if 44 - 44: i1IIi % i11i + I1Ii111
 @ api . model
 def create_or_show_license ( self ) :
  I1I1I = OOoO000O0OO . get_machine_code ( )
  OoOO000 = self . search ( [ ( 'mcode' , '=' , I1I1I ) ] , limit = 1 )
  if not OoOO000 :
   OoOO000 = self . create ( { "mcode" : I1I1I , "note" : "康虎云报表免写代码模块许可证" } )
  i1Ii11i1i = {
 'type' : 'ir.actions.act_window' ,
 'name' : _ ( '打印服务器地址' ) ,
 'view_mode' : 'form' ,
 'view_type' : 'form' ,
 'res_model' : 'cf.cfprint.license' ,
 'nodestroy' : 'true' ,
 'res_id' : OoOO000 . id ,
 'views' : [ ( False , 'form' ) ] ,

  'target' : 'current' ,
  }
  return i1Ii11i1i
  if 91 - 91: i1iIi11iIIi1I
 @ api . model
 def create ( self , vals ) :
  vals [ 'mcode' ] = oOooOo0 = OOoO000O0OO . get_machine_code ( ) or ''
  return super ( O000OOOOOo , self ) . create ( vals )
  if 38 - 38: i1iIii1Ii1II
 @ api . multi
 def write ( self , vals ) :
  vals [ 'mcode' ] = oOooOo0 = OOoO000O0OO . get_machine_code ( ) or ''
  return super ( O000OOOOOo , self ) . write ( vals )
  if 84 - 84: iIii1I11I1II1 % O0Oo0oO0o / iIii1I11I1II1 % I1Ii111
 @ api . multi
 def name_get ( self ) :
  return [ ( ii . id , "康虎云报表许可证" ) for ii in self ]
  if 84 - 84: oOoO0oo0OOOo % i11i . i11iIiiIii / i1iIi11iIIi1I
class o0O ( models . Model ) :
 _inherit = 'ir.model'
 if 2 - 2: iIii1I11I1II1 / Iii1ii1II11i + i1iIi11iIIi1I / I1iII1iiII
 def name_get ( self ) :
  return [ ( II . id , '%s(%s)' % ( II . name , II . model ) ) for II in self ]
  if 51 - 51: I11i11Ii - Iii1ii1II11i + i11i * OOo . I1Ii111 + Iii1ii1II11i
class OoO0o ( models . Model ) :
 _name = 'cf.report.define.category'
 _description = '报表定义类别'
 if 78 - 78: Iii1ii1II11i % O0 % OOo
 name = fields . Char ( string = "类别名称" , required = True , help = "为便于管理，报表定义进行分类。默认是“未分类”。" )
 lines = fields . One2many ( "cf.report.define" , "category_id" , string = "报表" )
 note = fields . Text ( string = "备注" )
 if 46 - 46: OoooooooOO . i11iIiiIii
class OOo0oO00ooO00 ( models . Model ) :
 _name = 'cf.report.printer'
 _description = '打印机名称'
 if 90 - 90: i11ii11iIi11i * i1iIii1Ii1II + oOoO0oo0OOOo
 name = fields . Char ( string = "打印机名称" , required = True , help = "报表打印要使用的客户端打印机名称，不设置则使用默认打印机。\n如果不清楚打印机名称，请不要填写！" )
 note = fields . Text ( string = "备注" )
 if 81 - 81: Iii1ii1II11i . oOoO0oo0OOOo % O0 / oOooOoO0Oo0O - Iii1ii1II11i
class Ii1I1i ( models . Model ) :
 _name = 'cf.report.define'
 _description = '报表定义'
 if 99 - 99: Iii1ii1II11i . O0Oo0oO0o + o00oo % Iii1ii1II11i . i11iIiiIii % O0
 def _compute_technical_name ( self ) :
  for oOO00O in self :
   oOO00O . technical_name = oOO00O . _get_report_name ( )
   if 77 - 77: I11i11Ii - i1IIi - I1Ii111 . i11ii11iIi11i
 name = fields . Char ( string = '报表ID' , required = True , copy = True , help = "用一确定报表的唯一ID，只允许英文、数字和下划线。" )
 comment = fields . Char ( string = '报表中文名称' , required = True , copy = True )
 technical_name = fields . Char ( string = "技术名称" , readonly = True , compute = "_compute_technical_name" , help = "报表的技术名称，主要用于其他地方直接调用报表。" )
 model_id = fields . Many2one ( 'ir.model' , string = '数据表(model)' , required = True , copy = True , help = "报表对应的数据表(model)" )
 template_id = fields . Many2one ( 'cf.template' , string = '报表模板' , copy = True , help = "该报表使用的打印模板。\n模板如果尚未设计，可以先创建一个模板定义，待生成数据并设计报表模板后再上传到模板库。" )
 company_id = fields . Many2one ( 'res.company' , string = '所属公司' , default = lambda IiI1i : IiI1i . env [ 'res.company' ] . _company_default_get ( '' ) )
 open_print = fields . Boolean ( string = "是否弹出打印" , default = False )
 hide_print_menu = fields . Boolean ( string = "隐藏打印菜单" , default = False , help = "是否隐藏打印菜单。如果隐藏，则需要通过二次开发来创建菜单或按钮调用报表。" )
 use_client_templ = fields . Boolean ( string = "使用客户端模板" , default = False , help = "打印时使用保存在打印客户端的打印模板。如果是，则需要输入client_templ_name" )
 client_templ_name = fields . Char ( string = "客户端模板文件名" , help = "如果设置了使用客户端模板，则在此录入客户端模板路径和文件名" )
 field_ids = fields . One2many ( "cf.report.define.field" , "report_id" , domain = lambda IiI1i : [ ( 'model_id' , '=' , IiI1i . model_id . id ) ] , string = "字段" , help = "要在报表模板中使用的字段信息" )
 prn_server_address = fields . Char ( string = "打印服务器地址" , default = "127.0.0.1" , help = "康虎云报表打印服务器地址，默认是127.0.0.1。\n如果不清楚该参数的含义，请勿修改该参数！" )
 prn_server_port = fields . Integer ( string = "打印服务器端口" , default = "54321" , help = "康虎云报表打印服务器端口，默认是54321。\n如果不清楚该参数的含义，请勿修改该参数！" )
 printer_id = fields . Many2one ( "cf.report.printer" , string = "打印机" , help = "要使用的打印机，留空则使用默认打印机" )
 category_id = fields . Many2one ( "cf.report.define.category" , string = "报表分类" , help = "报表类别，默认为未分类" )
 back_after_print = fields . Boolean ( string = "打印后返回" , default = False , help = "打印请求发送到打印伺服器后返回前页" )
 state = fields . Selection ( [ ( 'draft' , '草稿' ) , ( 'defined' , '完成报表定义' ) ] , string = "状态" , default = "draft" )
 note = fields . Text ( string = "备注" )
 if 92 - 92: II1iI . II1iI + i1iIi11iIIi1I
 _sql_constraints = [
 ( 'uniq_name' , 'unique(name)' , _ ( '报表名称必须唯一!' ) ) ,
 ]
 if 9 - 9: oOooOoO0Oo0O * O0 + II1iI - I1Ii111 * i1iIii1Ii1II
 @ api . model
 def create ( self , vals ) :
  if not vals . get ( "template_id" , False ) :
   Oooo0oOO = vals . get ( "name" , False )
   Ooo00O00o = vals . get ( "comment" , False )
   if not Oooo0oOO :
    raise ValidationError ( _ ( "请先指定报表ID！" ) )
   O0O00Oo = "cf_templ_%s" % ( IIi , Oooo0oOO . replace ( '.' , '_' ) )
   oooooo0O000o = self . env [ "cf.template" ] . search ( [ ( 'templ_id' , '=' , O0O00Oo ) ] , limit = 1 )
   if not oooooo0O000o :
    oooooo0O000o = self . env [ "cf.template" ] . create ( {
 "templ_id" : O0O00Oo ,
 "name" : ( Ooo00O00o or O0O00Oo ) + "打印模板" ,
 "description" : ( Ooo00O00o or O0O00Oo ) + "打印模板" ,
 } )
   vals [ "template_id" ] = oooooo0O000o . id
   if 64 - 64: oOooOoO0Oo0O . oOoO0oo0OOOo - i1iIii1Ii1II / OoooooooOO
  return super ( Ii1I1i , self ) . create ( vals )
  if 66 - 66: O0Oo0oO0o - O0Oo0oO0o - i11iIiiIii . IiiI - I1iII1iiII
 @ api . multi
 def unlink ( self ) :
  for oOOo0O00o in self :
   oOOo0O00o . _remove_report ( )
  return super ( Ii1I1i , self ) . unlink ( )
  if 8 - 8: i1iIi11iIIi1I
 def _get_report_id ( self ) :
  self . ensure_one ( )
  return "%s%s" % ( i1Iii1i1I , self . name )
  if 49 - 49: oOooOoO0Oo0O - I1Ii111
 def _get_report_name ( self , with_module = True ) :
  self . ensure_one ( )
  if with_module :
   return "cf_report_designer.%s%s" % ( IIi , self . name . replace ( '.' , '_' ) )
  else :
   return "%s%s" % ( IIi , self . name . replace ( '.' , '_' ) )
   if 74 - 74: iIii1I11I1II1 * IiiI + i11ii11iIi11i / i1IIi / i11i . I11i11Ii
 def _get_report_file ( self , with_module = True ) :
  self . ensure_one ( )
  if with_module :
   return "cf_report_designer.%s%s" % ( I1IiiI , self . name . replace ( '.' , '_' ) )
  else :
   return "%s%s" % ( I1IiiI , self . name . replace ( '.' , '_' ) )
   if 62 - 62: OoooooooOO * oOooOoO0Oo0O
 @ api . one
 def _remove_report ( self ) :
  oOOOoo0O0oO = self . _get_report_id ( )
  iIII1I111III = self . _get_report_name ( )
  IIo0o0O0O00oOOo = self . _get_report_file ( )
  if 14 - 14: i11ii11iIi11i + Iii1ii1II11i
  if 52 - 52: OoooooooOO - o00oo
  self . env [ "ir.model.data" ] . sudo ( ) . search ( [ ( 'name' , '=' , oOOOoo0O0oO ) ] ) . unlink ( )
  if 74 - 74: O0Oo0oO0o + oOoO0oo0OOOo
  oO00O000oO0 = self . env [ 'ir.actions.report' ] . sudo ( ) . search ( [ ( 'report_name' , '=' , iIII1I111III ) ] )
  for oOOo0O00o in oO00O000oO0 :
   oOOo0O00o . unlink_action ( )
   oOOo0O00o . unlink ( )
   if 79 - 79: I1Ii111 - OoooooooOO - Iii1ii1II11i - iIii1I11I1II1 * I1iII1iiII
   if 4 - 4: i11iIiiIii . OoooooooOO / i1iIi11iIIi1I % i1iIii1Ii1II % I1Ii111 * O0
  self . env [ 'ir.ui.view' ] . search ( [ ( 'key' , '=' , iIII1I111III ) ] ) . unlink ( )
  if 14 - 14: I1iII1iiII / oOoO0oo0OOOo
  if 32 - 32: oOooOoO0Oo0O * I11i11Ii
  if 78 - 78: I1iII1iiII - OoooooooOO - IiiI / o00oo / i11i
  if 29 - 29: oOooOoO0Oo0O % oOooOoO0Oo0O
  if 94 - 94: iIii1I11I1II1 / I11i11Ii % O0Oo0oO0o * O0Oo0oO0o * i11i
  if 29 - 29: i1iIi11iIIi1I + i11ii11iIi11i / oOoO0oo0OOOo / I1iII1iiII * iIii1I11I1II1
  if 62 - 62: I1iII1iiII / Iii1ii1II11i - i1iIi11iIIi1I . I1Ii111
  if 11 - 11: IiiI . i1iIi11iIIi1I * II1iI * OoooooooOO + o00oo
  if 33 - 33: O0 * oOoO0oo0OOOo - i1iIii1Ii1II % i1iIii1Ii1II
 def action_retrieve_fields ( self ) :
  if 18 - 18: i1iIii1Ii1II / I11i11Ii * i1iIii1Ii1II + i1iIii1Ii1II * i11iIiiIii * IiiI
  self . env [ "cf.report.define.field" ] . search ( [ ( 'report_id' , '=' , self . id ) ] ) . unlink ( )
  if 11 - 11: o00oo / i11ii11iIi11i - II1iI * OoooooooOO + OoooooooOO . i11ii11iIi11i
  if 26 - 26: OOo % IiiI
  if 76 - 76: II1iI * O0Oo0oO0o
  for ooooooo00o in self . model_id . field_id :
   if 73 - 73: I1iII1iiII
   ooO = self . env [ 'cf.report.define.field' ] . create ( {
 "report_id" : self . id ,
 "model_id" : ooooooo00o . model_id . id ,
 "field_id" : ooooooo00o . id ,

   } )
   if 51 - 51: oOooOoO0Oo0O % i1iIii1Ii1II . Iii1ii1II11i / iIii1I11I1II1 / I1Ii111 . Iii1ii1II11i
 def action_remove_fields ( self ) :
  self . env [ "cf.report.define.field" ] . search ( [ ( 'report_id' , '=' , self . id ) ] ) . unlink ( )
  if 42 - 42: oOoO0oo0OOOo + i1IIi - OOo / II1iI
  if 9 - 9: O0 % O0 - oOoO0oo0OOOo
 def _make_report_defind ( self ) :
  oOOOoo0O0oO = self . _get_report_id ( )
  if 51 - 51: oOooOoO0Oo0O . iIii1I11I1II1 - IiiI / O0
  iIII1I111III = self . _get_report_name ( )
  IIo0o0O0O00oOOo = self . _get_report_file ( )
  if 52 - 52: oOoO0oo0OOOo + O0 + O0Oo0oO0o + I11i11Ii % O0Oo0oO0o
  if 75 - 75: oOooOoO0Oo0O . o00oo . O0 * i1iIii1Ii1II
  i11II1I11I1 = self . env [ 'ir.actions.report' ]
  OOoOO0ooo = i11II1I11I1 . create ( {
 "name" : self . comment or self . name ,
 "type" : "ir.actions.report" ,
 "binding_type" : "report" ,
 "model" : self . model_id . model ,
 "report_type" : "qweb-html" ,
 "report_name" : iIII1I111III ,
 "report_file" : IIo0o0O0O00oOOo ,
  "multi" : False ,
 "print_report_name" : self . comment or self . name ,
  "attachment_use" : False ,
 "cf_report_define_id" : self . id ,
 "men" : "False" if self . hide_print_menu else "True" ,
 } )
  if OOoOO0ooo :
   self . env [ "ir.model.data" ] . create ( {
 "name" : "action_%s" % ( oOOOoo0O0oO ) ,
 "model" : "ir.actions.report" ,
 "module" : "cf_report_designer" ,
 "noupdate" : False ,
 "res_id" : OOoOO0ooo . id
 } )
   if 30 - 30: oOoO0oo0OOOo - i1IIi % i11i + I1Ii111 * iIii1I11I1II1
   OOoOO0ooo . create_action ( )
   if 81 - 81: II1iI % i1IIi . iIii1I11I1II1
 def _make_templ ( self ) :
  if 4 - 4: i11iIiiIii % i1iIi11iIIi1I % i1IIi / II1iI
  if 6 - 6: O0Oo0oO0o / oOooOoO0Oo0O % I1iII1iiII - oOooOoO0Oo0O
  iiii111II = "%s%s" % ( IIi , self . name . replace ( '.' , '_' ) )
  oOOOoo0O0oO = self . _get_report_id ( )
  iIII1I111III = self . _get_report_name ( )
  IIo0o0O0O00oOOo = self . _get_report_file ( )
  if 50 - 50: I1iII1iiII * oOooOoO0Oo0O % iIii1I11I1II1 + OOo + O0Oo0oO0o + oOooOoO0Oo0O
  OO0OoooO00o0 = self . _get_report_name ( False )
  if 20 - 20: Iii1ii1II11i % II1iI
  III1i1i11i = """<?xml version="1.0"?>
<t t-name="%s">
  <t t-call="cfprint.html_container">
    <t t-raw="show_message"/>
  </t>
<script type="text/javascript">
  <t t-raw="cfprint_json"/>
</script>
</t>
""" % ( OO0OoooO00o0 )
  if 100 - 100: Iii1ii1II11i / i1iIii1Ii1II / IiiI
  oOoOOo0O = self . env [ 'ir.ui.view' ]
  if 84 - 84: i1iIi11iIIi1I + i1IIi - i11i . IiiI * OoooooooOO + oOooOoO0Oo0O
  try :
   II1i11I = oOoOOo0O . create ( {
 "name" : oOOOoo0O0oO ,
 "key" : iIII1I111III ,
 "priority" : 16 ,
 "type" : "qweb" ,
 "arch_db" : III1i1i11i ,
 "mode" : "primary" ,
 "active" : True ,

   } )
   if II1i11I :
    if 50 - 50: OoooooooOO % I1Ii111
    self . env [ "ir.model.data" ] . create ( {
 "name" : OO0OoooO00o0 ,
 "model" : "ir.ui.view" ,
 "module" : "cf_report_designer" ,
 "noupdate" : False ,
 "res_id" : II1i11I . id
 } )
    if 49 - 49: Iii1ii1II11i - i11iIiiIii . i1iIii1Ii1II * OOo % O0Oo0oO0o + i1IIi
  except Exception as o0OO00 :
   iI1 . error ( "Create report template[%s] failed." % ( iIII1I111III ) )
   raise o0OO00
   if 71 - 71: oOoO0oo0OOOo
 def action_generate ( self ) :
  if 38 - 38: Iii1ii1II11i % i11ii11iIi11i + IiiI . i11iIiiIii
  if 53 - 53: i11iIiiIii * O0Oo0oO0o
  if 68 - 68: iIii1I11I1II1 * iIii1I11I1II1 . oOoO0oo0OOOo / i11i % I11i11Ii
  self . _remove_report ( )
  if 38 - 38: o00oo - I1iII1iiII / O0Oo0oO0o
  if 66 - 66: O0 % IiiI + i11iIiiIii . i11ii11iIi11i / OOo + IiiI
  self . _make_report_defind ( )
  if 86 - 86: oOoO0oo0OOOo
  if 5 - 5: II1iI * i11ii11iIi11i
  self . _make_templ ( )
  if 5 - 5: i1iIii1Ii1II
  self . write ( { "state" : "defined" } )
  if 90 - 90: i1iIii1Ii1II . o00oo / OOo - I1Ii111
 def action_design ( self ) :
  if 40 - 40: OoooooooOO
  if 25 - 25: II1iI + OOo / o00oo . oOoO0oo0OOOo % O0 * i1iIi11iIIi1I
  if 84 - 84: o00oo % OOo + i11iIiiIii
  II1I1Ii = self . env [ self . model_id . model ] . search ( [ ] , limit = 5 )
  Ooo0O0oooo = [ oo000o . id for oo000o in II1I1Ii ]
  if 36 - 36: OoooooooOO . i1iIi11iIIi1I
  if 56 - 56: I11i11Ii . IiiI . oOooOoO0Oo0O
  oOOOoo0O0oO = "cf_report_designer.%s%s" % ( i1Iii1i1I , self . name )
  if 39 - 39: O0 + i1iIii1Ii1II
  iIII1I111III = "cf_report_designer.%s%s" % ( IIi , self . name )
  OoOooOoO = { "is_design" : True ,
 "docs" : II1I1Ii ,
 "docids" : Ooo0O0oooo
 }
  if 43 - 43: i11i . Iii1ii1II11i / IiiI
  return ( self . env [ 'ir.actions.report' ] . search ( [ ( 'report_name' , '=' , iIII1I111III ) ] , limit = 1 )
 . with_context ( { 'is_design' : True } )
 . report_action ( Ooo0O0oooo , data = OoOooOoO ) )
  if 20 - 20: oOooOoO0Oo0O
  if 95 - 95: O0Oo0oO0o - oOooOoO0Oo0O
class I1ii1ii11i1I ( models . Model ) :
 _name = 'cf.report.define.field'
 _description = '报表字段'
 _order = 'report_id, id'
 if 58 - 58: O0Oo0oO0o + I11i11Ii
 report_id = fields . Many2one ( "cf.report.define" , string = "报表定义" , required = True , ondelete = 'cascade' , help = "字段所在的报表定义" )
 model_id = fields . Many2one ( 'ir.model' , string = "数据表(模型)" , required = True , ondelete = 'cascade' , help = "字段所在的model" )
 model_name = fields . Char ( related = "model_id.name" , string = "模型名称" )
 field_id = fields . Many2one ( "ir.model.fields" , string = "字段" , required = True , ondelete = 'cascade' )
 name = fields . Char ( related = "field_id.name" , string = '字段名称' )
 field_description = fields . Char ( related = "field_id.field_description" , string = '字段说明' )
 ttype = fields . Selection ( related = "field_id.ttype" , string = '字段类型' )
 related_field_id = fields . Many2one ( "cf.report.define.field" , string = "关联字段" , help = "与关联表关联的字段(related_external_field_ids)" , oldname = "parent_field_id" )
 related_external_field_ids = fields . One2many ( "cf.report.define.field" , "related_field_id" , string = "关联数据表字段" , help = "与当前表相关联的表字段" , oldname = "sub_field_ids" )
 note = fields . Text ( string = "备注" )
 if 12 - 12: oOoO0oo0OOOo - IiiI % i11ii11iIi11i * I1Ii111
 related_field_model_id = fields . Many2one ( 'ir.model' , compute = "_compute_relation_model" , string = "关联数据表（模型）" , help = "关联字段所在的model。当前字段为One2many，Many2many，Many2one时有值。" )
 related_field_model_name = fields . Char ( related = "related_field_model_id.name" , string = "关联数据表名称" , help = "关联字段所在的model名称" )
 if 44 - 44: O0Oo0oO0o % OOo
 _sql_constraints = [
 ( 'uniq_repoer_model_field' , 'unique(report_id, model_id, related_field_id, field_id)' , '报表 + 表 + 关联上级字段 + 字段必须唯一!' ) ,
 ]
 if 41 - 41: i1IIi - I1Ii111 - OOo
 @ api . model
 def create ( self , vals ) :
  if 8 - 8: i1iIi11iIIi1I + i1iIii1Ii1II - oOoO0oo0OOOo % I11i11Ii % oOoO0oo0OOOo * Iii1ii1II11i
  if not vals . get ( "model_id" , False ) :
   ooO = self . env [ "ir.model.fields" ] . browse ( vals . get ( "field_id" , 0 ) )
   if ooO :
    vals [ "model_id" ] = ooO . model_id . id
    if 9 - 9: I11i11Ii - i11iIiiIii - I1iII1iiII * OOo + o00oo
    if 44 - 44: i11i
  self . search ( [ ( 'report_id' , '=' , vals . get ( "report_id" , 0 ) ) , ( 'model_id' , '=' , vals . get ( "model_id" , 0 ) ) ,
 ( 'related_field_id' , '=' , vals . get ( "related_field_id" , 0 ) ) , ( 'field_id' , '=' , vals . get ( "field_id" , 0 ) ) ] ) . unlink ( )
  if 52 - 52: IiiI - I11i11Ii + IiiI % oOoO0oo0OOOo
  return super ( I1ii1ii11i1I , self ) . create ( vals )
  if 35 - 35: iIii1I11I1II1
 def _compute_relation_model ( self ) :
  for ooO in self :
   I1i = self . env [ 'ir.model' ] . _get ( ooO . field_id . relation )
   ooO . related_field_model_id = I1i . id if I1i else None
   if 32 - 32: i11ii11iIi11i / i1iIi11iIIi1I + I1iII1iiII
 def action_retrieve_fields ( self ) :
  if self . field_id and ( self . field_id . ttype == 'one2many' or self . field_id . ttype == 'many2many' or self . field_id . ttype == 'many2one' ) :
   if 32 - 32: iIii1I11I1II1 % O0Oo0oO0o
   if self . env . get ( self . field_id . relation , '_EMPTY' ) == '_EMPTY' :
    raise AccessError ( _ ( "未找到关联字段对应的表（%s），无法获取关联表字段！" % ( self . field_id . relation ) ) )
    if 65 - 65: o00oo . OoooooooOO / IiiI . i1IIi * i1iIi11iIIi1I
    if 19 - 19: i11iIiiIii + OoooooooOO - I11i11Ii - I1Ii111
   Iii1iiIi1II = self . env [ 'ir.model' ] . _get ( self . field_id . relation )
   if 60 - 60: oOooOoO0Oo0O - Iii1ii1II11i * I1Ii111 % i11i
   if 62 - 62: iIii1I11I1II1
   self . action_remove_fields ( )
   if 12 - 12: I1iII1iiII / oOoO0oo0OOOo
   if 42 - 42: I11i11Ii
   for ooooooo00o in Iii1iiIi1II . field_id :
    ooO = self . env [ 'cf.report.define.field' ] . create ( {
 "related_field_id" : self . id ,
 "report_id" : self . report_id . id ,
 "model_id" : ooooooo00o . model_id . id ,
 "field_id" : ooooooo00o . id ,
 } )
    if 19 - 19: Iii1ii1II11i % IiiI * iIii1I11I1II1 + oOooOoO0Oo0O
 def action_remove_fields ( self ) :
  if self . field_id and ( self . field_id . ttype == 'one2many' or self . field_id . ttype == 'many2many' or self . field_id . ttype == 'many2one' ) :
   if 46 - 46: I11i11Ii
   Iii1iiIi1II = self . env [ 'ir.model' ] . _get ( self . field_id . relation )
   if 1 - 1: O0Oo0oO0o
   if 97 - 97: I1iII1iiII + O0Oo0oO0o + O0 + i11iIiiIii
   self . env [ "cf.report.define.field" ] . search ( [ ( 'report_id' , '=' , self . report_id . id ) , ( 'model_id' , '=' , Iii1iiIi1II . id ) , ( 'related_field_id' , '=' , self . id ) ] ) . unlink ( )
   if 77 - 77: oOoO0oo0OOOo / OoooooooOO
 def action_view_sub_fields ( self ) :
  self . ensure_one ( )
  if 46 - 46: oOoO0oo0OOOo % iIii1I11I1II1 . O0Oo0oO0o % O0Oo0oO0o + i11iIiiIii
  Oo00o0OO0O00o = self . env . ref ( 'cf_report_designer.cf_report_define_field_form' ) . id
  return { 'type' : 'ir.actions.act_window' ,
 'res_model' : 'cf.report.define.field' ,
 'view_mode' : 'form' ,
 'views' : [ ( Oo00o0OO0O00o , 'form' ) ] ,
 'res_id' : self . id ,
 'target' : 'new' ,
 'limit' : 1000 ,
 'name' : '关联表字段' ,
 'flags' : { 'form' : { 'action_buttons' : False } }
 }
  if 82 - 82: I1Ii111 + OoooooooOO - i1IIi . i1IIi
  if 6 - 6: oOoO0oo0OOOo / I1Ii111 / i11i
  if 27 - 27: I1iII1iiII * o00oo . i1iIii1Ii1II % II1iI * II1iI . i1IIi
  if 72 - 72: I1iII1iiII % IiiI + i1iIi11iIIi1I / Iii1ii1II11i + II1iI
  if 10 - 10: i1iIii1Ii1II / o00oo + i11iIiiIii / OOo
  if 74 - 74: I1iII1iiII + O0 + i1IIi - i1IIi + i11i
  if 83 - 83: IiiI - oOooOoO0Oo0O + I1iII1iiII
from xml . dom import minidom
import uuid
if 5 - 5: OOo
iIi1i1iIi1iI = "<h5 style=\"margin-top: 3rem; text-align: center;\">%s</h4>"
if 26 - 26: OoooooooOO * oOooOoO0Oo0O + I1iII1iiII
if 24 - 24: i11iIiiIii % iIii1I11I1II1 + I1iII1iiII / i11iIiiIii
class OOooO0oo0o00o ( models . Model ) :
 if 100 - 100: oOoO0oo0OOOo
 _inherit = 'ir.actions.report'
 if 1 - 1: I1Ii111 + OoooooooOO - I1iII1iiII + II1iI
 if 9 - 9: OOo
 if 59 - 59: oOooOoO0Oo0O * i11i . O0
 _description = 'Report Action'
 if 56 - 56: OOo - O0Oo0oO0o % oOooOoO0Oo0O - oOoO0oo0OOOo
 cf_report_define_id = fields . Many2one ( "cf.report.define" , string = "报表定义" , help = "如果是康虎云报表，则保存对应的报表定义。" )
 if 51 - 51: O0 / o00oo * iIii1I11I1II1 + IiiI + oOoO0oo0OOOo
 def _make_cfprint_json ( self , values ) :
  if 98 - 98: iIii1I11I1II1 * IiiI * I1iII1iiII + o00oo % i11iIiiIii % O0
  if 27 - 27: O0
  def OOO0oOOoo ( lst ) :
   oOOO00o000o = set ( )
   if 9 - 9: Iii1ii1II11i + I1Ii111 / I1Ii111
   if 12 - 12: OoooooooOO % oOoO0oo0OOOo * I1Ii111 % iIii1I11I1II1 / OOo
   if 27 - 27: i11iIiiIii % i11i % I1Ii111 . O0 - I11i11Ii + i11ii11iIi11i
   if 57 - 57: iIii1I11I1II1 / I1Ii111 - i1IIi
   if 51 - 51: II1iI
   ii11I1 = [ ]
   oO0oo = time . clock ( )
   for Ii111iIi1iIi in lst :
    IIIII = tuple ( Ii111iIi1iIi . items ( ) )
    if IIIII not in oOOO00o000o :
     oOOO00o000o . add ( IIIII )
     ii11I1 . append ( Ii111iIi1iIi )
     if 78 - 78: OOo * i1IIi
   iI11 = time . clock ( )
   print ( "_remove_duplicated consume: %f" % ( ( iI11 - oO0oo ) ) )
   return ii11I1
   if 96 - 96: I1iII1iiII
  def OOoi1i11I1I1iii1 ( field ) :
   I1iii11 = "str"
   if 74 - 74: O0 / i1IIi
   if 78 - 78: OoooooooOO . i1iIi11iIIi1I + o00oo - i1IIi
   if 31 - 31: OoooooooOO . I1iII1iiII
   if 83 - 83: O0Oo0oO0o . O0 / I11i11Ii / I1iII1iiII - i11i
   if 100 - 100: i1iIi11iIIi1I
   if field . ttype in [ "binary" ] :
    I1iii11 = "blob"
   elif field . ttype in [ "boolean" ] :
    I1iii11 = "boolean"
   elif field . ttype in [ 'char' , 'selection' , 'reference' ] :
    I1iii11 = "str"
   elif field . ttype in [ 'text' , 'html' ] :
    I1iii11 = "text"
   elif field . ttype in [ 'date' , 'datetime' ] :
    I1iii11 = "date"
   elif field . ttype in [ 'float' , 'monetary' ] :
    I1iii11 = "float"
   elif field . ttype in [ "integer" , "many2one" ] :
    I1iii11 = "int"
   return I1iii11
   if 46 - 46: i11ii11iIi11i / iIii1I11I1II1 % O0Oo0oO0o . iIii1I11I1II1 * O0Oo0oO0o
  def IIi1ii1Ii ( report_define , model , fields , docs , datas , related_field = False ) :
   OoOoO = { }
   if 83 - 83: I1iII1iiII . i1IIi / OoooooooOO
   if 28 - 28: Iii1ii1II11i . i11i / IiiI + i11i . OoooooooOO . II1iI
   if 53 - 53: OOo % OOo * oOoO0oo0OOOo + i11ii11iIi11i
   if 92 - 92: OoooooooOO + i1IIi / OOo * O0
   if 100 - 100: o00oo % iIii1I11I1II1 * i11i - O0Oo0oO0o
   if 92 - 92: o00oo
   if 22 - 22: I11i11Ii % O0Oo0oO0o * IiiI / I1iII1iiII % i11iIiiIii * I1Ii111
   if 95 - 95: OoooooooOO - II1iI * oOooOoO0Oo0O + i11ii11iIi11i
   if 10 - 10: oOoO0oo0OOOo / i11iIiiIii
   if 92 - 92: I1Ii111 . i1iIii1Ii1II
   if 85 - 85: IiiI . i1iIii1Ii1II
   O0O0Ooooo000 = model . model . replace ( "." , "_" )
   if 65 - 65: I1iII1iiII * i1iIii1Ii1II
   if 79 - 79: OoooooooOO - oOooOoO0Oo0O
   if 69 - 69: I1Ii111
   if 95 - 95: o00oo + i11iIiiIii * i1iIii1Ii1II - i1IIi * i1iIii1Ii1II - iIii1I11I1II1
   if 75 - 75: OoooooooOO * II1iI
   if 9 - 9: II1iI - i11i + O0 / iIii1I11I1II1 / i11iIiiIii
   if not datas . get ( O0O0Ooooo000 , False ) :
    datas [ O0O0Ooooo000 ] = { "cols" : [ ] , "rows" : [ ] }
    if 39 - 39: II1iI * I11i11Ii + iIii1I11I1II1 - II1iI + I1iII1iiII
   o0 = datas [ O0O0Ooooo000 ] [ "cols" ]
   if 30 - 30: O0 * OoooooooOO
   I1iIIIi1 = 255
   if 17 - 17: iIii1I11I1II1 . OoooooooOO / I1Ii111 % i11i % i1IIi / i11iIiiIii
   oO0oo = time . clock ( )
   for ii in docs :
    OOO = { }
    for ooO in [ Ii111iIi1iIi for Ii111iIi1iIi in fields if Ii111iIi1iIi . model_id . model == model . model ] :
     try :
      if ooO . ttype == 'binary' :
       OOO [ ooO . name ] = "base64/jpg:%s" % ( ii [ ooO . name ] . strip ( ) . decode ( "UTF-8" ) . replace ( "\n" , "" ) if ii [ ooO . name ] else "" )
       if 30 - 30: OoooooooOO - OoooooooOO . O0 / O0Oo0oO0o
      elif ooO . ttype in [ 'boolean' ] :
       OOO [ ooO . name ] = ii [ ooO . name ]
       if 31 - 31: I1iII1iiII + oOoO0oo0OOOo . OoooooooOO
      elif ooO . ttype in [ 'char' , 'text' , 'html' , 'reference' ] :
       OOO [ ooO . name ] = ii [ ooO . name ] if ii [ ooO . name ] else ""
       if len ( OOO [ ooO . name ] ) > OoOoO . get ( ooO . name , I1iIIIi1 ) :
        OoOoO [ ooO . name ] = len ( OOO [ ooO . name ] )
        if 89 - 89: i11i + i1IIi + i11i
      elif ooO . ttype in [ 'date' , 'datetime' ] :
       OOO [ ooO . name ] = ii [ ooO . name ] . strftime ( "%Y-%m-%d %H:%M:%S" ) if ii [ ooO . name ] else ""
       if 7 - 7: O0 % oOoO0oo0OOOo + IiiI * O0Oo0oO0o - O0Oo0oO0o
      elif ooO . ttype in [ 'float' , 'integer' , 'monetary' ] :
       OOO [ ooO . name ] = ii [ ooO . name ] if ii [ ooO . name ] != None else ""
       if 42 - 42: i11ii11iIi11i * i11ii11iIi11i * i1iIii1Ii1II . I1Ii111
      elif ooO . ttype in [ "one2many" , "many2many" ] and len ( ooO . related_external_field_ids ) > 0 :
       O0Oo0o000oO = ii [ ooO . name ]
       oO0o00oOOooO0 = ooO . related_external_field_ids
       OOOoO000 = self . env [ 'ir.model' ] . _get ( ooO . field_id . relation )
       if 57 - 57: i11i
       if oO0o00oOOooO0 and len ( oO0o00oOOooO0 ) > 0 and OOOoO000 :
        IIi1ii1Ii ( report_define , OOOoO000 , oO0o00oOOooO0 , O0Oo0o000oO , datas )
        if 54 - 54: I11i11Ii + Iii1ii1II11i + i11iIiiIii
      elif ooO . ttype in [ 'many2one' ] :
       OOO [ ooO . name ] = ii [ ooO . name ] . id if ii [ ooO . name ] else ""
       OOO [ ooO . name + "_name" ] = ii [ ooO . name ] . name if ii [ ooO . name ] and ii [ ooO . name ] . name else ""
       OOO [ ooO . name + "_display_name" ] = ii [ ooO . name ] . display_name if ii [ ooO . name ] and ii [ ooO . name ] . display_name else ""
       if len ( OOO [ ooO . name + "_name" ] ) > OoOoO . get ( ooO . name + "_name" , I1iIIIi1 ) :
        OoOoO [ ooO . name + "_name" ] = len ( OOO [ ooO . name + "_name" ] )
       if len ( OOO [ ooO . name + "_display_name" ] ) > OoOoO . get ( ooO . name + "_display_name" , I1iIIIi1 ) :
        OoOoO [ ooO . name + "_display_name" ] = len ( OOO [ ooO . name + "_display_name" ] )
        if 28 - 28: Iii1ii1II11i
        if 70 - 70: II1iI
       if len ( ooO . related_external_field_ids ) > 0 :
        O0Oo0o000oO = ii [ ooO . name ]
        oO0o00oOOooO0 = ooO . related_external_field_ids
        OOOoO000 = self . env [ 'ir.model' ] . _get ( ooO . field_id . relation )
        if 34 - 34: i1iIii1Ii1II % II1iI
        if oO0o00oOOooO0 and len ( oO0o00oOOooO0 ) > 0 and OOOoO000 :
         IIi1ii1Ii ( report_define , OOOoO000 , oO0o00oOOooO0 , O0Oo0o000oO , datas , ooO )
         if 3 - 3: i11i / I1iII1iiII + II1iI . o00oo . i1iIi11iIIi1I
      elif ooO . ttype in [ 'selection' ] :
       OOO [ ooO . name ] = ii [ ooO . name ] if ii [ ooO . name ] else ""
       Oooo0oOO = dict ( ii . _fields [ ooO . name ] . _description_selection ( ii . env ) ) . get ( OOO [ ooO . name ] , '' )
       OOO [ ooO . name + "_name" ] = Oooo0oOO or ""
       if len ( OOO [ ooO . name + "_name" ] ) > OoOoO . get ( ooO . name + "_name" , I1iIIIi1 ) :
        OoOoO [ ooO . name + "_name" ] = len ( OOO [ ooO . name + "_name" ] )
        if 83 - 83: Iii1ii1II11i + OoooooooOO
     except Exception as I111IiiIi1 :
      iI1 . error ( _ ( "生成康虎云报表打印数据出错。model: %s, field: %s, Error: %s" ) % ( model . model , ooO . name , I111IiiIi1 ) )
      pass
      if 88 - 88: OoooooooOO
    if OOO :
     datas [ O0O0Ooooo000 ] [ "rows" ] . append ( OOO )
     if 84 - 84: i11ii11iIi11i / I1Ii111 * O0Oo0oO0o / Iii1ii1II11i - i11iIiiIii . I11i11Ii
     if 60 - 60: IiiI * oOooOoO0Oo0O
   for ooO in [ Ii111iIi1iIi for Ii111iIi1iIi in fields if Ii111iIi1iIi . model_id . model == model . model ] :
    I1iii11 = OOoi1i11I1I1iii1 ( ooO )
    if 17 - 17: I1iII1iiII % I11i11Ii / IiiI . II1iI * I1iII1iiII - i11i
    i1i1IIii1i1 = I1iIIIi1
    if I1iii11 == "str" :
     i1i1IIii1i1 = OoOoO . get ( ooO . name , I1iIIIi1 )
    if I1iii11 == "text" :
     i1i1IIii1i1 = OoOoO . get ( ooO . name , I1iIIIi1 )
     I1iii11 == "str"
     if 65 - 65: oOooOoO0Oo0O + i11ii11iIi11i / I1iII1iiII
    datas [ O0O0Ooooo000 ] [ "cols" ] . append ( { "type" : I1iii11 , "size" : i1i1IIii1i1 , "name" : ooO . name , "required" : False , "comment" : ooO . field_description } )
    if 83 - 83: oOoO0oo0OOOo . O0Oo0oO0o - I11i11Ii
    if 65 - 65: iIii1I11I1II1 / o00oo . II1iI - i11i
    if ooO . ttype in [ "many2one" ] :
     datas [ O0O0Ooooo000 ] [ "cols" ] . append ( { "type" : "str" , "size" : OoOoO . get ( ooO . name + "_name" , I1iIIIi1 ) , "name" : ooO . name + "_name" , "required" : False , "comment" : ooO . field_description } )
     if 72 - 72: iIii1I11I1II1 / II1iI % O0Oo0oO0o % I1iII1iiII - I1Ii111 % I1iII1iiII
    if ooO . ttype in [ "many2one" ] :
     datas [ O0O0Ooooo000 ] [ "cols" ] . append ( { "type" : "str" , "size" : OoOoO . get ( ooO . name + "_name" , I1iIIIi1 ) , "name" : ooO . name + "_name" , "required" : False , "comment" : ooO . field_description } )
     datas [ O0O0Ooooo000 ] [ "cols" ] . append ( { "type" : "str" , "size" : OoOoO . get ( ooO . name + "_display_name" , I1iIIIi1 ) , "name" : ooO . name + "_display_name" , "required" : False , "comment" : ooO . field_description } )
     if 100 - 100: I11i11Ii + i11iIiiIii
    if ooO . ttype in [ "selection" ] :
     datas [ O0O0Ooooo000 ] [ "cols" ] . append ( { "type" : "str" , "size" : OoOoO . get ( ooO . name + "_name" , I1iIIIi1 ) , "name" : ooO . name + "_name" , "required" : False , "comment" : ooO . field_description } )
     if 71 - 71: I1Ii111 / oOoO0oo0OOOo / i1iIii1Ii1II % I1iII1iiII
   datas [ O0O0Ooooo000 ] [ "cols" ] = OOO0oOOoo ( datas [ O0O0Ooooo000 ] [ "cols" ] )
   if 51 - 51: II1iI * O0 / i11i . OOo % I1iII1iiII / oOooOoO0Oo0O
   iI11 = time . clock ( )
   print ( "_make_data_obj[%s] consume: %f" % ( O0O0Ooooo000 , ( iI11 - oO0oo ) ) )
   return datas
   if 9 - 9: oOooOoO0Oo0O % oOooOoO0Oo0O % i11i
   if 30 - 30: II1iI + i1iIii1Ii1II - II1iI . II1iI - i11i + O0
   if 86 - 86: i1IIi
  IIi11IIiIii1 = values . get ( "report_define" )
  oOooOo0 = OOoO000O0OO . get_machine_code ( ) or ''
  if 17 - 17: OOo + Iii1ii1II11i . i1iIi11iIIi1I - I11i11Ii * i11iIiiIii
  iioOo0OoOOo0 = {
 "template" : "" ,
 "ver" : 4 ,
 "Copies" : values . get ( "print_copies" , 1 ) ,
  "Duplex" : 0 ,
 "mcode" : oOooOo0 ,
 "Tables" : [ ]
 }
  if 30 - 30: IiiI % oOooOoO0Oo0O
  if IIi11IIiIii1 . printer_id and IIi11IIiIii1 . printer_id != '' :
   iioOo0OoOOo0 [ "printer" ] = IIi11IIiIii1 . printer_id . name
   if 89 - 89: i1iIii1Ii1II + OoooooooOO + i1iIii1Ii1II * i1IIi + iIii1I11I1II1 % I1Ii111
  oOo0oO = self . _context . get ( "is_design" , False )
  if oOo0oO :
   iioOo0OoOOo0 [ "design" ] = True
   IIi1IIIIi = iIi1i1iIi1iI % ( _ ( """请在康虎云报表设计器设计报表。<br/>
            如果报表设计器未打开，请检查康虎云报表是否已启动！<br/><br/><br/>
            模板设计完成后，请在odoo菜单“康虎云报表”--&gt;“模板”菜单中，打开模板记录上传或更新模板！<br/><br/>
            <a href=\"cfprint://open\">启动康虎云报表</a>
            """ ) )
   values . update ( show_message = IIi1IIIIi )
   if 70 - 70: I1iII1iiII / i11i - iIii1I11I1II1 - O0Oo0oO0o
  if IIi11IIiIii1 . use_client_templ and IIi11IIiIii1 . client_templ_name :
   iioOo0OoOOo0 [ "template" ] = IIi11IIiIii1 . client_templ_name
  else :
   if not IIi11IIiIii1 . template_id or not IIi11IIiIii1 . template_id . templ_id :
    values . update ( show_message = iIi1i1iIi1iI % ( _ ( "未指定要打印的报表模板，请先指定报表模板。" ) ) )
   Iii = self . env [ 'cf.template' ] . search ( [ ( 'templ_id' , '=' , IIi11IIiIii1 . template_id . templ_id ) ] , limit = 1 ) . template
   if not Iii or Iii == "" :
    if not oOo0oO :
     values . update ( show_message = iIi1i1iIi1iI % ( _ ( "指定的报表模板未定义或模板无内容，请先设计模板并更新到模板记录表。</h3>" ) ) )
    else :
     iioOo0OoOOo0 [ "template" ] = "cf_templ_%s" % ( IIi11IIiIii1 . name . replace ( '.' , '_' ) )
   else :
    iioOo0OoOOo0 [ "template" ] = "base64:" + Iii . strip ( ) . decode ( "UTF-8" ) . replace ( "\n" , "" )
    if 20 - 20: oOoO0oo0OOOo / i1IIi
  II1I1Ii = values . get ( "docs" )
  if not II1I1Ii or len ( II1I1Ii ) < 1 :
   oO = self . _context . get ( "active_ids" , [ ] )
   II1I1Ii = self . env [ IIi11IIiIii1 . model_id . model ] . browse ( oO )
   if 21 - 21: i11iIiiIii / i1iIii1Ii1II % I1iII1iiII * O0 . I1Ii111 - iIii1I11I1II1
  OoOooOoO = { }
  oO0oo = time . clock ( )
  IIi1ii1Ii ( IIi11IIiIii1 , IIi11IIiIii1 . model_id , IIi11IIiIii1 . field_ids , II1I1Ii , OoOooOoO )
  iI11 = time . clock ( )
  print ( "_make_data_obj consume:  %f" % ( iI11 - oO0oo ) )
  if 26 - 26: i11i * i11ii11iIi11i
  if 10 - 10: i11i . O0Oo0oO0o
  for I1iOOOO , ( ooO0oO00O0o , ooOO00oOOo000 ) in enumerate ( OoOooOoO . items ( ) ) :
   if 14 - 14: i1iIi11iIIi1I . i11i . I1Ii111 / OOo % IiiI - o00oo
   o0oOoO0O = ooO0oO00O0o . replace ( "." , "_" )
   o0 = ooOO00oOOo000 [ "cols" ]
   OoOo000oOo0oo = ooOO00oOOo000 [ "rows" ]
   iioOo0OoOOo0 [ "Tables" ] . append ( {
 "Name" : o0oOoO0O ,
 "Cols" : o0 ,
 "Data" : OoOo000oOo0oo ,
 } )
   if 65 - 65: i11ii11iIi11i / i1iIi11iIIi1I % II1iI
  return iioOo0OoOOo0
  if 45 - 45: i11ii11iIi11i
 def _set_report_data ( self , values , report_data ) :
  if 66 - 66: i1iIi11iIIi1I
  if 56 - 56: O0
  IIi11IIiIii1 = values . get ( "report_define" )
  if 61 - 61: oOoO0oo0OOOo / I1iII1iiII / I11i11Ii * O0
  iIII1i1i = "127.0.0.1"
  IiI1iii11iIi1 = 54321
  i1iI11I1II1 = self . env [ "cf.print.server.user.mapping" ] . search ( [ ( 'user_id' , '=' , self . env . user . id ) ] , limit = 1 )
  if i1iI11I1II1 and i1iI11I1II1 . prn_server_ip :
   iIII1i1i = i1iI11I1II1 . prn_server_ip
   if i1iI11I1II1 . prn_server_port and i1iI11I1II1 . prn_server_port > 0 and i1iI11I1II1 . prn_server_port < 65535 : IiI1iii11iIi1 = i1iI11I1II1 . prn_server_port
  else :
   iIII1i1i = IIi11IIiIii1 . prn_server_address or "127.0.0.1"
   IiI1iii11iIi1 = IIi11IIiIii1 . prn_server_port if IIi11IIiIii1 . prn_server_port and IIi11IIiIii1 . prn_server_port > 0 and IIi11IIiIii1 . prn_server_port < 65535 else 54321
   if 14 - 14: i11iIiiIii - O0Oo0oO0o * i11ii11iIi11i
   if 51 - 51: IiiI / iIii1I11I1II1 % Iii1ii1II11i + oOoO0oo0OOOo * o00oo + i1iIii1Ii1II
  o0OoO00o0000O = [
 'var cfprint_addr = \"%s\"' % ( iIII1i1i ) ,
 'var cfprint_port = %d' % ( IiI1iii11iIi1 ) ,
 "var _delay_close = -1"
 ]
  iI1 . debug ( 'Dump report data to json...' )
  II11I = json . dumps ( report_data , ensure_ascii = False )
  if 96 - 96: oOooOoO0Oo0O % I11i11Ii . IiiI + I1iII1iiII
  if 42 - 42: i11i * O0Oo0oO0o * i11iIiiIii - I1iII1iiII . OoooooooOO
  iI1 . debug ( 'Encrypt report data...' )
  I1I111 = OOoO000O0OO . rand_aes_key ( 16 , False )
  iI1 . debug ( "AES Key: %s" % ( I1I111 ) )
  oo00o = OOoO000O0OO ( I1I111 , AES . MODE_CBC )
  oO0oo = time . clock ( )
  oo0000Oo00o = oo00o . encrypt ( II11I )
  iI11 = time . clock ( )
  print ( "Encrypt consume: %f" % ( iI11 - oO0oo ) )
  if 67 - 67: o00oo + oOooOoO0Oo0O * i11iIiiIii - Iii1ii1II11i / II1iI % O0Oo0oO0o
  if 92 - 92: OOo - Iii1ii1II11i - o00oo % OoooooooOO / I1iII1iiII
  iI1 . debug ( 'Encrypt key...' )
  if 19 - 19: I11i11Ii - i1iIi11iIIi1I
  if 56 - 56: IiiI
  if 26 - 26: OoooooooOO % OoooooooOO
  if 33 - 33: i1iIii1Ii1II
  oo00o = OOoO000O0OO ( o00ooooO0oO ( ) , AES . MODE_CBC )
  OOO0ooo = oo00o . encrypt ( I1I111 )
  if 7 - 7: oOoO0oo0OOOo + i1IIi . oOooOoO0Oo0O / I11i11Ii
  I111i1I1 = {
 "token" : OOO0ooo . decode ( "utf-8" ) ,
 "dea" : "aes" ,
  "tea" : "aes" ,
  "data" : oo0000Oo00o . decode ( "utf-8" )
 }
  if 62 - 62: I1iII1iiII * i1iIii1Ii1II / I11i11Ii * oOoO0oo0OOOo
  iI1 . debug ( 'Dump final_data...' )
  if 29 - 29: I11i11Ii % i1iIi11iIIi1I % II1iI . oOoO0oo0OOOo / OoooooooOO * o00oo
  o0OoO00o0000O . append ( "var _data = %s" % ( json . dumps ( I111i1I1 , ensure_ascii = False ) ) )
  if 54 - 54: O0
  o0OoO00o0000O . append ( """_reportData = JSON.stringify(_data);\nconsole.log(_reportData);""" )
  if 68 - 68: i1iIi11iIIi1I * oOoO0oo0OOOo . o00oo % Iii1ii1II11i % i1iIii1Ii1II
  if 75 - 75: i11ii11iIi11i
  if IIi11IIiIii1 . back_after_print :
   o0OoO00o0000O . append ( """
            function _delay(ms) { return new Promise(resolve => setTimeout(resolve, ms)); } \n 
            _delay(1000).then(() => window.history.go(-1));  /*延迟一秒后返回到上一页*/""" )
  i1 = ";\n" . join ( o0OoO00o0000O )
  iI1 . debug ( 'json_data: %s ...' % ( i1 [ 0 : 300 ] ) )
  if 56 - 56: i11i / Iii1ii1II11i + i11iIiiIii + I1iII1iiII
  values . update (
 cfprint_json = i1 ,
 )
  if 54 - 54: OOo - I1Ii111 - i1iIii1Ii1II . iIii1I11I1II1
 @ api . multi
 def render ( self , template , values = None ) :
  if values is None :
   if 79 - 79: OOo . i1iIi11iIIi1I
   if 40 - 40: oOoO0oo0OOOo + I11i11Ii . oOoO0oo0OOOo % o00oo
   if 15 - 15: OOo * I11i11Ii % IiiI * iIii1I11I1II1 - i11iIiiIii
   if 60 - 60: oOooOoO0Oo0O * i1iIii1Ii1II % i1iIi11iIIi1I + Iii1ii1II11i
   if 52 - 52: i1IIi
   if 84 - 84: OOo / II1iI
   values = { }
   if 86 - 86: i11ii11iIi11i * i11i - O0 . i11ii11iIi11i % iIii1I11I1II1 / I1iII1iiII
  iI1 . debug ( "Render report..." )
  OOoOO0ooo = self . _get_report_from_name ( template )
  if not OOoOO0ooo :
   raise AccessError ( _ ( "未找到报表（%s）定义，可能是报表未定义或定义未生效，如果使用康虎云报表，请在报表定义中重新生成一下报表定义！" % ( template ) ) )
   if 11 - 11: oOooOoO0Oo0O * Iii1ii1II11i + IiiI / IiiI
  IIi1IIIIi = iIi1i1iIi1iI % ( _ ( "正在打印，请稍候...<br/><br/>如果打印机未输出报表，请检查康虎云报表是否已启动！<br/><br/><a href=\"cfprint://open\">启动康虎云报表</a>" ) )
  if 37 - 37: i11iIiiIii + i1IIi
  iI1 . debug ( "Prepare docs..." )
  II1I1Ii = values . get ( "docs" , False )
  if not II1I1Ii or len ( II1I1Ii ) < 1 :
   oO = self . _context . get ( "active_ids" , [ ] )
   II1I1Ii = self . env [ OOoOO0ooo . model ] . browse ( oO )
   values . update ( docs = II1I1Ii )
  if not II1I1Ii or len ( II1I1Ii ) < 1 :
   IIi1IIIIi = iIi1i1iIi1iI % ( _ ( "没有可以打印数据。" ) )
   if 23 - 23: O0Oo0oO0o + I1Ii111 . i11ii11iIi11i * oOooOoO0Oo0O + IiiI
  iI1 . debug ( "Retrieve report define..." )
  if 18 - 18: II1iI * oOoO0oo0OOOo . II1iI / O0
  iiIII1II = OOoOO0ooo . xml_id . split ( "." )
  if len ( iiIII1II ) > 1 :
   iiIII1II = iiIII1II [ 1 ] . replace ( i1Iii1i1I , "" )
  else :
   iiIII1II = iiIII1II [ 0 ] . replace ( i1Iii1i1I , "" )
   if 100 - 100: I11i11Ii % OOo / I1Ii111
  values . update (
 show_message = IIi1IIIIi
 )
  if 30 - 30: I11i11Ii - I1iII1iiII - O0Oo0oO0o
  if 81 - 81: oOoO0oo0OOOo . OoooooooOO + I1iII1iiII * o00oo
  ooOoOo = self . env [ "cf.report.define" ] . search ( [ ( 'name' , '=' , iiIII1II ) ] , limit = 1 )
  if 21 - 21: i11ii11iIi11i + i11iIiiIii + oOooOoO0Oo0O * oOoO0oo0OOOo % O0Oo0oO0o % i11i
  iI1 . debug ( "Prepare to make json...[%s]" % ( iiIII1II ) )
  if ooOoOo :
   iI1 . debug ( "Set report_define to values..." )
   values . update ( report_define = ooOoOo , )
   iI1 . debug ( "Begin to make report data ..." )
   oOO0OO0OO = self . _make_cfprint_json ( values )
   iI1 . debug ( "Begin to convert report data to json..." )
   self . _set_report_data ( values , oOO0OO0OO )
   iI1 . debug ( "Converted!!!" )
   if 87 - 87: Iii1ii1II11i + iIii1I11I1II1 - OoooooooOO
  IiI1 = super ( OOooO0oo0o00o , self ) . render ( template , values )
  return IiI1
  if 12 - 12: I1Ii111 % i11ii11iIi11i
 def action_upload_templ_win ( self ) :
  i1i = self . _context . get ( "templ_id" , False )
  return {
 'name' : _ ( '上传康虎云报表模板' ) ,
 'type' : 'ir.actions.act_window' ,
 'view_type' : 'form' ,
 'res_model' : 'cf.template' ,
 'res_id' : i1i ,

  'context' : self . _context ,
 'target' : 'current' ,
 'nodestroy' : True
 }
  if 5 - 5: Iii1ii1II11i . IiiI . i11i . OoooooooOO
 @ api . model
 def render_qweb_html ( self , docids , data = None ) :
  if 96 - 96: i11iIiiIii - I1iII1iiII % O0 / i1iIi11iIIi1I
  O0O0 = data . get ( "is_design" , False )
  oo0OOOoOo = _ ( "设计" ) if O0O0 else _ ( "打印" )
  if 21 - 21: i1iIi11iIIi1I - O0 . Iii1ii1II11i + OOo . iIii1I11I1II1 - i11ii11iIi11i
  ooOoOo = self . cf_report_define_id
  if ooOoOo :
   if not docids :
    docids = data . get ( "docids" , None )
    if 14 - 14: II1iI % Iii1ii1II11i % I11i11Ii - i11iIiiIii
   IIi1IIIIi = iIi1i1iIi1iI % ( _ ( "正在打印，请稍候...<br/><br/>如果打印机未输出报表，请检查康虎云报表是否已启动！<br/><br/><a href=\"cfprint://open\">启动康虎云报表</a>" ) )
   if 53 - 53: OOo % I11i11Ii
   II1I1Ii = data . get ( "docs" , False )
   if 59 - 59: I1iII1iiII % iIii1I11I1II1 . i1IIi + i11i * II1iI
   if ( not II1I1Ii or len ( II1I1Ii ) < 1 ) and ( not docids or len ( docids ) < 1 ) :
    docids = self . _context . get ( "active_ids" , [ ] )
    if 41 - 41: OOo % IiiI
   if ( not II1I1Ii or not isinstance ( II1I1Ii , list ) or len ( II1I1Ii ) < 1 ) and docids and ooOoOo and ooOoOo . model_id and ooOoOo . model_id . model :
    II1I1Ii = self . env [ ooOoOo . model_id . model ] . browse ( docids )
    if 12 - 12: I1iII1iiII
   if ( not II1I1Ii or len ( II1I1Ii ) < 1 ) and ( not docids or len ( docids ) < 1 ) :
    IIi1IIIIi = iIi1i1iIi1iI % ( _ ( "没有可以%s数据。" ) % ( oo0OOOoOo ) )
    if 69 - 69: OoooooooOO + I1iII1iiII
   data . update ( docs = II1I1Ii , show_message = IIi1IIIIi , )
   if 26 - 26: I11i11Ii + I1iII1iiII / i1iIi11iIIi1I % i11ii11iIi11i % IiiI + i11i
   if ooOoOo :
    data . update ( report_define = ooOoOo , )
    oO0oo = time . clock ( )
    oOO0OO0OO = self . with_context ( is_design = O0O0 ) . _make_cfprint_json ( data )
    iI11 = time . clock ( )
    print ( "_make_cfprint_json consume:  %f" % ( iI11 - oO0oo ) )
    self . _set_report_data ( data , oOO0OO0OO )
    if 31 - 31: I1Ii111 % I1iII1iiII * I1Ii111
  return super ( OOooO0oo0o00o , self ) . render_qweb_html ( docids , data )
  if 45 - 45: i1IIi . oOooOoO0Oo0O + I1iII1iiII - OoooooooOO % o00oo
  if 1 - 1: iIii1I11I1II1
# dd678faae9ac167bc83abf78e5cb2f3f0688d3a3
